<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/8
 * Time: 21:40
 */

namespace app\admin\model;


use think\Model;

class Quxiaoorder extends Model
{
    protected $name='quxiaoorder';

    public function getlist($order_mun){
        return self::field('user_id as userid,addtime,type,quxiao_remake')
            ->where('order_mun',$order_mun)
            ->select();
    }

    public function getUseridAttr($v,$data){
        if ($data['type'] == 1 || $data['type'] == 2){
            return Member::get($v)['real_name'];
        }elseif ($data['type'] == 3 || $data['type'] == 4){
            return '用户';
        }elseif ($data['type'] == 5){
            return '后台';
        }
    }


    public function getTypeAttr($v){
        $msg = ['','师傅取消','师傅转让','用户更换师傅','用户退款','后台取消'];
        return $msg[$v];
    }
}